<html>
<head>
<link href="../../Objects/sofa_white.css" rel="stylesheet" type="text/css" />
</head>
<body>
	<div id="contenu">		
		<center><h3>Topology Hexa2QuadTopologicalMapping</h3></center>
	        <center><img src="TopologyHexa2QuadTopologicalMapping_01.png" width="300" name="TopologyHexa2QuadTopologicalMapping" align="middle"></center>		
	<br>	
	<div id="orangeText">Description</div>
	<br>
<div align="left">
	The aim of this tutorial is to show the interest of using a topological mapping between a 3D volume mesh and a 2D surface mesh. In this tutorial, a cube is represented, implying:
	<ul>
		<li>A mesh loader to read mesh file. (not necessary in regular mesh)</li>
		<li>A mechanicalObject with geometry point positions.</li>
		<li>A mass for gravity and fixed points.</li>
		<li>A FEM forcefield to create interactiona between points</li>
		<li>An ODE scheme and a linear solver to solve the system at each time step.</li>
		<li>Dynamic topological components.</li>
		<li>A visual modela which reproduce the current model geometry thanks to the identity mapping.</li>
	</ul>
        <br>
	<div id="orangeText">Key points</div>
	<br>
	Under the first node representing the hexahedra, a second node is used to represent the quad topology.
	<br>
	This second representation won't reproduce all quads of the hexahedra topology, but only quads on the mesh borders. I.e quads with only one adjacent hexahedron. This process is similar to the <a href="TopologyTetra2TriangleTopologicalMapping.scn">Tetra2TriangleTopologicalMapping</a>.
	<br>
	Edges of hexahedra are represented in yellow in the simulation whereas the visual model is based on the quads. Thus, display the scene in wire frame to see hexahedra and quads (in green).
	<br>
	<br>
	To create this mapping, the component <b>Hexa2QuadTopologicalMapping</b> is used. This component takes an input topology (Data Object1) which is the container of the "upper" topology (hexahedron here) and has an output topology (Data Object2) which is the container of the above topology (quad here).
	<br>
	<br>
	<div id="orangeText">Results</div>
	<br>
	As explained, the visual model uses the output topology (quads) to render the surface model.
	<br>
	you can try to use directly the quads created in the <b>HexahedronSetTopologyContainer</b> for the ogl model. The result will be a cube with quads displayed inside the volume.
	<br>
	<br>
	Finally, try to remove the <b>HexahedronFEMForceField</b> or <b>QuadularBendingSprings</b> component. The result will be a bad behavior of the cube.
	<br>
	<center><img src="TopologyHexa2QuadTopologicalMapping_02.png" width="300" name="TopologyHexa2QuadTopologicalMapping" align="middle">
	</center>
	<br>
	<ul>
	  <li><div id="orangeText">Additional results</div></li>		
	<br>
	When deleting quads, the topological mapping is updated. Thus, hexahedra behind the selected quad will be deleted as well. Then, the list of quads on the border will be updated and the surface rendering also.
	</ul>
</div>
</div>
</body>
</html>
